/*
Date:20220109 12:33AM
key:没啥好说很简单
*/
class Solution {
public:
    char slowestKey(vector<int>& releaseTimes, string keysPressed) {
    int Max=0;
    char Max_char;
    for(int i=0;i<releaseTimes.size();i++)
    {
        if(i==0)
        {
            Max=releaseTimes[0];
            Max_char=keysPressed[0];
        }
        else{
            int tmp=releaseTimes[i]-releaseTimes[i-1];
            if(Max<tmp)
            {
                Max=tmp;
                Max_char=keysPressed[i];
            }
            if(Max==tmp)
            {
                Max_char=max(Max_char,keysPressed[i]);
            }
        }
    }
    return Max_char;
    }
};